﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Staff
{
    public partial class set_active : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = int.Parse(Request.QueryString["id"]);
            var get_manager = new TblManagerController().FetchAll().Where(x => x.ManagerId == id).Single();
            bool active;
            if(get_manager.Active==true)
                active=false;
            else
                active=true;

            new TblManagerController().Update(get_manager.ManagerId, get_manager.ManagerName, get_manager.ManagerPass, get_manager.Role, get_manager.FullName, get_manager.Birthday, get_manager.Sex, get_manager.Avatar,get_manager.Captain, get_manager.Phone, get_manager.Email, get_manager.Facebook, get_manager.Address, active,get_manager.Wallpaper, get_manager.Note);
        }
    }
}